pro plot_powspec

  @general_settings

  ; get plot dimensions
  plot_dim = plot_dimensions(1,1)
  ; we don't need second y-axis so add on to x2 pos
  plot_dim.pltpos[0,2] += 0.05

  ; plot
  set_plot,'ps' 
  dir = './'

  ; zooming
  xlims = [1.0e-2 ,1.0e2]
  ylims = [1.0e-3,1.0e2]

  ; all
  xlims = [1.0e-6 ,1.0e7]
  ylims = [1.0e-15,1.0e5]

  myplot_ps  = 'PowSpecComparison.ps'
  myplot_pdf = 'PowSpecComparison.pdf'
  device,/portrait,/color,filename=dir+myplot_ps,xsize=plot_dim.size[0],ysize=plot_dim.size[1],encapsulated=1
  !p.font = -1 

  xlab = TEXtoIDL("k [h Mpc^{-1}]")
  ylab = TEXtoIDL("k^3P(k)")

  xyouts,0.440,0.015,xlab,$  
         charthick=5.0,charsize=1.5,color=black,/normal
  xyouts,0.04,0.48,ylab,orientation=90.0,$
         charthick=5.0,charsize=1.5,color=black,/normal

  ; plot the lines
  dummy = fltarr(1)
  iplot = 0
  plot,dummy,color=black,/noerase,/xl,/yl,xtickformat='exponent',ytickformat='exponent',$
       pos=plot_dim.pltpos[iplot,*],xr=xlims,yr=ylims,xs=1,ys=1,$
       thick=5.0,xthick=5.0,ythick=5.0,charthick=5.0,charsize=1.3
  
  readcol,'billennium_powspec.txt'  ,bill_k,bill_Pk
  readcol,'wmap5_wide_powspec.dat',WMAP5_wide_k,WMAP5_wide_Pk

  oplot,10.0^bill_k,10.0^bill_Pk,thick=15.0,color=black
  oplot,10.^WMAP5_wide_k,10.^WMAP5_wide_Pk,thick=5.0,color=red

  plots,[0.43,0.48],[0.26,0.26],color=black,thick=5.0,/normal
  plots,[0.43,0.48],[0.21,0.21],color=red  ,thick=5.0,/normal
  xyouts,0.5,0.25,TEXtoIDL("WMAP1, n_s=1.000, Aquarius") ,charsize=1.3,charthick=5.0,/normal
  xyouts,0.5,0.20,TEXtoIDL("WMAP5, n_s=0.963, OWLS/Resim"),charsize=1.3,charthick=5.0,/normal

  device,/close
  spawn,'ps2pdf -dEPSCrop '+dir+myplot_ps+' '+dir+myplot_pdf,res,err
  spawn,'\rm '+dir+myplot_ps

  stop

end

